<template>
  <div class="outer">
    <p>hello</p>
    <p>{{ list }}</p>
    <ListVue ref="one" />
  </div>
</template>

<script>
import ListVue from "./components/List.vue";
// 使用lodash包实现深拷贝(cloneDeep)
import _ from "lodash";
export default {
  name: "App",
  components: { ListVue },
  data() {
    return {
      list: [],
    };
  },
  methods: {
    // 自定义事件的回调函数
    fn(list) {
      this.list = [...list];
    },
  },
  mounted() {
    this.$refs.one.$on("atguigu", this.fn);
  },
};
</script>

<style scoped>
.outer {
  width: 300px;
  background-color: aqua;
}
</style>